package com.naiterui.ehp.bs.pharmacist.controller.inner;

import java.util.Date;
import java.util.List;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.naiterui.ehp.bs.pharmacist.service.ISuperviseService;
import com.naiterui.ehp.bs.pharmacist.vo.supervise.SupervisePharmacistVO;

import cn.hutool.core.date.DateUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * @author luao
 * @date 2021/6/21 2:06 下午
 **/
@Slf4j
@RestController
@RequestMapping("pharmacist/inner/supervise")
@RequiredArgsConstructor
public class PharmacistInnerSuperviseController {

    private final ISuperviseService superviseService;

    @GetMapping
    public List<SupervisePharmacistVO> pharmacistList(String startDate, String endDate, Long pharmacistId) {
        log.info("药师列表  startDate:{},endDate:{},pharmacistId:{}", startDate, endDate, pharmacistId);
        Date start = DateUtil.parseDateTime(startDate).toJdkDate();
        Date end = DateUtil.parseDateTime(endDate).toJdkDate();
        return superviseService.pharmacistList(start, end, pharmacistId);
    }
}
